
package cn.edu.sjtu.se.dslab.helper;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/** 
 * @ClassName: ApplicationContextHelper
 * @Description:  Help to get the reference of the ApplicationContext
 * @author longshaohang
 * @date 2013-9-17 下午11:58:42
 * 
 */
public class ApplicationContextHelpler implements ApplicationContextAware{

	private static ApplicationContext applicationContext;
	
	@Override
	public void setApplicationContext(ApplicationContext ac)
			throws BeansException {
		applicationContext = ac;
	}
	
	public static Object getBean(String beanName){
		return applicationContext.getBean(beanName);
	}
	
	
	
	
}
